# #打印100以内能被三整除的数字
# for i1  in range(1,100):
#     if i1%3==0:
#         print(i1,end="\t")

# 产生随机数
# from random import random, randint
# num = randint(1,100)
# while True:
#     guess = int(int(input("请输入一个数字：")))
#     if guess>num:
#         print("你猜大了")
#     elif guess<num:
#         print("你猜小了")
#     else:
#         print("猜对了")
#         break

# 打印九九乘法表
for i in range(1, 10):
    for j in range(1, i + 1):
        print(j + "*" + "i" + "＝" + j * i, end="\t")
    print()

 # 打印菱形(调用center函数)
    for i in range(1, 11, 2):
        print(("*" * i).center(11))
    for i in range(11, 1, -2):
        print(("*" * i).center(11))
  # 打印菱形
    x = int(input('请输入菱形宽度：'))
    for i in range(1, x):
        for j in range(0, i):
            print(' ', end='')
        print((x - i) * '* ')

 # 打印水仙花数
    for i in range(100, 1000):
        ge = i % 10
        shi = i // 10 % 10
        bai = i // 100
        if i == ge ** 3 + shi ** 3 + bai ** 3:
            print(i)
    print("--------")

# 打印100以内质数
    list = []
    for i in range(2, 100):
        for j in range(2, i):
            if i % j == 0:
                break
        else:
            list.append(i)
    print(list)

 # 打印100以内的完数
    for i in range(1, 101):
        sum = 0
        for j in range(1, i):
            if i % j == 0:
                sum += j
        if sum == i:
            print(i, end="\t")

# 打印斐波那契
for i in range(1, 10 + 1):
    for j in range(1, i + 1):
        print(j, end="\t")
    print()


